<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JQ层次选择器</title>
    <script src="../../../../../lib/JQuery3.7.1.js"></script>
</head>
<body>
  <ul class="ul1">
    <li class="li1"></li>
    <li class="li2"></li>
    <li class="li2"></li>
  </ul>
  <ul></ul>
<script>
  console.log("获取ul下所有的子li:")
  console.log($('ul>li'));
  console.log('"获取ul下所有的后代li:"')
  console.log($('ul li'));
  console.log('获取li1后面所有的li兄弟元素')
  console.log($('.li1~.li2'))
  console.log('获取ul1紧邻的兄弟元素')
  console.log($('.ul1+ul'))
</script>
</body>
</html>